From: Simon McVittie Date: Thu, 15 Nov 2012 15:09:51 +0000 (+0000) Subject: st_widget_recompute_style: short-circuit if the theme node is the same X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5439 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4fc6a804f58ac0a31633a6ad2394e673fcbfa1cc;p=gnome-shell.git st_widget_recompute_style: short-circuit if the theme node is the same It appears to be somewhat common for st_widget_style_changed() to be called when no style-relevant attributes have, in fact, changed. Now that we cache theme nodes, we're likely to get the same theme node back from the cache. If we do, we don't need to waste time asking whether its geometry and painting are equal to itself: we can just note that nothing really changed and get on with our lives. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687465 Reviewed-by: Jasper St. Pierre --- diff --git a/src/st/st-widget.c b/src/st/st-widget.c index 2a9b8da26..b1218d3fb 100644 --- a/src/st/st-widget.c +++ b/src/st/st-widget.c @@ -1532,6 +1532,12 @@ st_widget_recompute_style (StWidget *widget, int transition_duration; gboolean paint_equal; + if (new_theme_node == old_theme_node) + { + widget->priv->is_style_dirty = FALSE; + return; + } + if (!old_theme_node || !st_theme_node_geometry_equal (old_theme_node, new_theme_node)) clutter_actor_queue_relayout ((ClutterActor *) widget);